import React, { useState, useEffect } from 'react'






function Hokes (props) {
  const [count, setCount] = useState(0)
  useEffect(() => {
    // 使用浏览器的 API 更新页面标题
    document.title = `You clicked ${count} times`;
    // console.log(count, props)
  });
  
  const cb = (val) => {
    console.log(val, 'jjjjj')
    // return (val) => {
      props.callBack(val)
    // }
  }

  return (
    <div>
      这是一个hook测试用demo
      <div >数字：{count}</div>
      <button onClick={() => setCount(count + 1)}>按钮</button>
      <button onClick={() => cb('按钮')}>按钮</button>
    </div>
  )
}

export default Hokes